package com.cloudkinto.service.orderoutput;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderOutputDo;
import com.cloudkinto.service.orderoutput.vo.*;
import com.cloudkinto.service.orderoutput.vo.BatchPickUpReq;
import com.cloudkinto.service.orderoutput.vo.cutoff.CutOffReq;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-06-04
 */
public interface OrderOutputService extends IService<OrderOutputDo> {

    SingleResult addInit(Long currentUserId, Long companyId);

    String add(OrderOutputAddReq req, Long userId);

    SingleResult reissue(OrderOutputReissueReq req, Long userId);

    SingleResult updateInit(Long id);

    OrderOutputUpdateReq update(OrderOutputUpdateReq updateVo, Long userId);

    void cutoff(Long id, Long userId);

    void cutoff(CutOffReq req, Long userId);

    void finishCutOff(Long id, Long userId);

    int delete(Long id, Long userId);

    OrderOutputDetailRes detail(Long id);

    SingleResult pageInit(Long companyId, Long currentUserId);

    List<OrderOutputListRes> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);

    List<String> dealwithExcel(MultipartFile file, int storageId, int shopId, Long userid);

    void exportExcel(Map<String, String> map, List<Long> ids, HttpServletResponse response) throws IOException;

    SingleResult exportTrackExpress(Map<String, String> map, List<Long> ids, Long currentUserId, HttpServletResponse response) throws IOException;

    void batchSendApi(String[] ids, Long userId);

    SingleResult updateTrackNumber(OrderOutputUpdateTrackNumberReq req, Long userId, Long companyId);

    boolean back2Stock(Long id, String fee, String type, Long userId);

    OrderOutputUpdateTrackNumberRes updateTrackNumberInit(Long id, Long userId, Long companyId);

    void exportSkuTotal(Map<String, String> map, List<Long> ids, Long currentUserId, HttpServletResponse response);

    void exportPickExcel(Map<String, String> map, List<Long> ids, HttpServletResponse response);

    Map dealwithTrackNumberExcel(MultipartFile file, Integer storageId, Long userid);

    void confirmSentOut(List<Long> orderListSuccess, Long userid);

    List<Map> uploadExcelInit(Long userid);

    void getExpressStatus(String s);

    void updateArchivedExpressCode();

    void postExpress2Api();

    List<String> addRakutenList(List<OrderOutputAddReq> orderOutputAddReqList, Long currentUserId);

    List<String> addAmazonList(Iterable<OrderOutputAddReq> orderOutputAddReqList, Long userId);

    List<String> addShopifyList(Iterable<OrderOutputAddReq> orderOutputAddReqList, Long userId);

    void uploadTrackNumberData(List<String> excelImportList, int storageId, Long userid);

    Map dealwithExcelData(List<OrderOutputTrackNumberExcelImport> excelImportList, int storageId, final Long userid);

    void orderToCheck(Map<Long, String> orderListSuccess, Map<String, List<OrderOutputTrackNumberExcelImport>> mapCollect, Long userid);

    void shipfeeFix(List<String> orderNumbers, int type, Long userId);

    double dealwithOrderSendOutShipFeeFix(OrderOutputDo outputDo, int type, Long userId);

    boolean yamatoExpressSmallSize(double[] size, Long storageId, Integer cod, Integer shipmentType);

    SingleResult updateOrderWaitSend(Map<String, String> map, List<Long> ids, Long currentUserId, HttpServletResponse response);

    void autoUploadNoYetExpressNumber();

    void autoUploadLasHourExpressNumber();

    void autoUploadLasHourExpressNumber1();


    void exportOtherStorageEmailExpress(Map<String, String> map, List<Long> ids, Long currentUserId);

    void exportTrackJPostExpress(Map<String, String> map, List<Long> ids, Long currentUserId, HttpServletResponse response);

    void exportOtherStorageExpress(Map<String, String> map, List<Long> ids, Long currentUserId, HttpServletResponse response);

    void countStorageWorks(long l);

    Long getProductId(String sellerSku, Long companyId);

    Long getProductId(String sellerSku, Long companyId, int type);

    List<String> addYahooList(List<OrderOutputAddReq> resList, Long userId);

    Object updateStock(OrderOutputUpdateReq req, Long userId);

    void sendMail2SKL();

    List<BatchPickUpRes> batchPickUp(BatchPickUpReq req, Long userId, Long companyId);

    SingleResult batchPickUpConfirm(BatchPickUpConfirmReq res, Long userId, Long companyId);

    void exportYamatoSizeExcel(Map<String, String> map, List<Long> ids, HttpServletResponse response);

    void sendYamatoSizeMail();


    void setOrderTypeSync();

    List<String> addQoo10List(List<OrderOutputAddReq> orderOutputAddReqList, Long currentUserId);

    void cancelOrderByRakutenOrderId(List<String> cancelOrderIds);

    void cancelOrderByOrderId(String platform, List<String> cancelOrderIds);

}
